package com.whfc.base.dao;

import com.whfc.base.dto.AppWeatherDayDTO;
import com.whfc.base.dto.AppWeatherLogDTO;
import com.whfc.base.entity.AppHourlyWeather;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;

import java.util.Date;
import java.util.List;

@Repository
public interface AppHourlyWeatherMapper {
    int deleteByPrimaryKey(Integer id);

    int insert(AppHourlyWeather record);

    int insertSelective(AppHourlyWeather record);

    AppHourlyWeather selectByPrimaryKey(Integer id);

    int updateByPrimaryKeySelective(AppHourlyWeather record);

    int updateByPrimaryKey(AppHourlyWeather record);

    void insertOrUpdate(@Param("list") List<AppHourlyWeather> list);

    List<AppWeatherLogDTO> selectByDeptIdAndTime(@Param("deptId") Integer deptId,
                                                 @Param("startTime") Date startTime,
                                                 @Param("endTime") Date endTime);

    /**
     * 获取历史天气预报(按月查询，每天3个时间段)
     *
     * @param deptId
     * @param time
     * @return
     */
    List<AppWeatherLogDTO> selectMonthByDeptIdAndTime(@Param("deptId") Integer deptId, @Param("time") String time);

    /**
     * 获取历史天气预报(按月查询，每天3个时间段)
     *
     * @param deptId
     * @param time
     * @return
     */
    List<AppWeatherLogDTO> selectMonthByDeptIdAndTheDay(@Param("deptId") Integer deptId, @Param("time") String time);

    /**
     * 获取当天天气
     *
     * @param deptId
     * @param startTime
     * @param endTime
     * @return
     */
    AppWeatherDayDTO selectDayByDateIdAndTime(@Param("deptId")Integer deptId, @Param("startTime")Date startTime, @Param("endTime")Date endTime);
}
